package controllers;

import apidocs.Api;
import apidocs.ApiParam;
import apidocs.ApiService;
import beans.consts.BooleanEnum;
import beans.dto.ExampleUser;

/**
 * 示例API，可删除
 * @author zhangzc
 * @since 5/29/18
 */
@ApiService(value = "API示例", author = "维护者姓名<邮箱>", weight = 10)
public class ExampleAPI extends BaseController {

    @Api(name = "保存用户数据", desc = "这里可以放置接口的说明", resultType = ExampleUser.class, requestMethod = "GET", resultNote = "这里可以放置结果的说明", weight = 49)
    public static void saveUser(@ApiParam(value = "name", name = "名称", note = "这里可以放置字段的说明，比如不能超过xx位") String name,
                                @ApiParam(value = "password", name = "密码") String password,
                                @ApiParam(value = "enable", name = "是否启用", enumType = BooleanEnum.class) Integer enable) {

        //TODO 各种业务处理
        ExampleUser user = new ExampleUser();
        user.name = name;
        user.password = password;
        //返回
        wsOk(user);
    }
}
